<?php echo $header; ?>
<div id="content">
    <div class="breadcrumb">
        <?php foreach ($breadcrumbs as $breadcrumb) { ?>
        <?php echo $breadcrumb['separator']; ?><a href="<?php echo $breadcrumb['href']; ?>"><?php echo $breadcrumb['text']; ?></a>
        <?php } ?>
    </div>
    <?php if ($error_warning) { ?>
    <div class="warning"><?php echo $error_warning; ?></div>
    <?php } ?>
    <div class="box">
        <div class="heading">
            <h1><img src="view/image/category.png" alt="" /> <?php echo $heading_title; ?></h1>
            <div class="buttons"><a onclick="$('#form').submit();" class="button"><?php echo $button_save; ?></a><a onclick="location = '<?php echo $cancel; ?>';" class="button"><?php echo $button_cancel; ?></a></div>
        </div>
        <div class="content">
            <div id="tabs" class="htabs"><a href="#tab-user"><?php echo $tab_user; ?></a><a href="#tab-posting"><?php echo $tab_posting; ?></a><a href="#tab-system"><?php echo $tab_system; ?></a></div>
            <form action="" method="post" id="form">
                <div id="tab-user">
                    <table class="form">
                        <tr>
                            <td><?php echo $entry_avatar_max_size; ?></td>
                            <td><input type="text" name="max_avatar_size" value="<?php echo $max_avatar_size; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_allowed_avatar_type; ?></td>
                            <td><input type="text" name="allowtypes" value="<?php echo $allowtypes; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_avatar_max_width; ?></td>
                            <td><input type="text" name="max_avatar_width" value="<?php echo $max_avatar_width; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_avatar_max_height; ?></td>
                            <td><input type="text" name="max_avatar_height" value="<?php echo $max_avatar_height; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_disallowed_user_name; ?></td>
                            <td><textarea name="disallow_username"><?php echo $disallow_username; ?></textarea></td>
                        </tr>
                    </table>
                </div>
                <div id="tab-posting">
                    <table class="form">
                        <tr>
                            <td><?php echo $entry_cart_forums; ?></td>
                            <td><div class="scrollbox">
                                <?php $class = 'odd'; ?>
                                <?php foreach ($forums as $forum) { ?>
                                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                                <div class="<?php echo $class; ?>">
                                    <?php if (in_array($forum['forum_id'], $cart_allowed_forums)) { ?>
                                    <input type="checkbox" name="cart_topic_allowed_forums[]" value="<?php echo $forum['forum_id']; ?>" checked="checked" />
                                    <?php echo $forum['forum_name']; ?>
                                    <?php } else { ?>
                                    <input type="checkbox" name="cart_topic_allowed_forums[]" value="<?php echo $forum['forum_id']; ?>" />
                                    <?php echo $forum['forum_name']; ?>
                                    <?php } ?>
                                </div>
                                <?php if(isset($sub_forums[$forum['forum_id']])){ ?>
                                <?php  foreach ($sub_forums[$forum['forum_id']] as $sub_forum) { ?>
                                <?php $class = ($class == 'even' ? 'odd' : 'even'); ?>
                                <div class="<?php echo $class; ?>">
                                    <?php if (in_array($sub_forum['forum_id'], $cart_allowed_forums)) { ?>
                                    <input type="checkbox" name="cart_topic_allowed_forums[]" value="<?php echo $sub_forum['forum_id']; ?>" checked="checked" />
                                    <?php echo $sub_forum['forum_name']; ?>
                                    <?php } else { ?>
                                    <input type="checkbox" name="cart_topic_allowed_forums[]" value="<?php echo $sub_forum['forum_id']; ?>" />
                                    <?php echo $sub_forum['forum_name']; ?>
                                    <?php } ?>
                                </div>
                                <?php } ?>
                                <?php } ?>
                                <?php } ?>
                            </div>
                                <a onclick="$(this).parent().find(':checkbox').attr('checked', true);"><?php echo $text_select_all; ?></a> / <a onclick="$(this).parent().find(':checkbox').attr('checked', false);"><?php echo $text_unselect_all; ?></a></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_posting_max_subject_length; ?></td>
                            <td><input type="text" name="posting_max_subject_length" value="<?php echo $posting_max_subject_length; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_posting_max_content_length; ?></td>
                            <td><input type="text" name="posting_max_content_length" value="<?php echo $posting_max_content_length; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_post_num_per_page; ?></td>
                            <td><input type="text" name="topic_max_posts_per_page" value="<?php echo $topic_max_posts_per_page; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_topic_num_per_page; ?></td>
                            <td><input type="text" name="forum_max_topic_per_page" value="<?php echo $forum_max_topic_per_page; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_daily_awarded_posting_count; ?></td>
                            <td><input type="text" name="daily_awarded_posting_count" value="<?php echo $daily_awarded_posting_count; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_posting_awarded_forum_points; ?></td>
                            <td><input type="text" name="posting_awarded_forum_points" value="<?php echo $posting_awarded_forum_points; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_best_answer_awarded_forum_points; ?></td>
                            <td><input type="text" name="best_answer_awarded_forum_points" value="<?php echo $best_answer_awarded_forum_points; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_featured_topic_awarded_forum_points; ?></td>
                            <td><input type="text" name="featured_topic_awarded_forum_points" value="<?php echo $featured_topic_awarded_forum_points; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_bbcode_parsing_status; ?></td>
                            <td><select name="bbcode_parsing_enable">
                                <?php if ($bbcode_parsing_enable) { ?>
                                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                <option value="0"><?php echo $text_disabled; ?></option>
                                <?php } else { ?>
                                <option value="1"><?php echo $text_enabled; ?></option>
                                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                <?php } ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_bbcode_img_parsing_status; ?></td>
                            <td><select name="bbcode_img_parsing_enable">
                                <?php if ($bbcode_img_parsing_enable) { ?>
                                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                <option value="0"><?php echo $text_disabled; ?></option>
                                <?php } else { ?>
                                <option value="1"><?php echo $text_enabled; ?></option>
                                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                <?php } ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_bbcode_flash_parsing_status; ?></td>
                            <td><select name="bbcode_flash_parsing_enable">
                                <?php if ($bbcode_flash_parsing_enable) { ?>
                                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                <option value="0"><?php echo $text_disabled; ?></option>
                                <?php } else { ?>
                                <option value="1"><?php echo $text_enabled; ?></option>
                                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                <?php } ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_bbcode_url_parsing_status; ?></td>
                            <td><select name="bbcode_url_parsing_enable">
                                <?php if ($bbcode_url_parsing_enable) { ?>
                                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                <option value="0"><?php echo $text_disabled; ?></option>
                                <?php } else { ?>
                                <option value="1"><?php echo $text_enabled; ?></option>
                                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                <?php } ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_smiles_parsing_status; ?></td>
                            <td><select name="smiles_parsing_enable">
                                <?php if ($smiles_parsing_enable) { ?>
                                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                <option value="0"><?php echo $text_disabled; ?></option>
                                <?php } else { ?>
                                <option value="1"><?php echo $text_enabled; ?></option>
                                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                <?php } ?>
                            </select></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_auto_url_parsing_status; ?></td>
                            <td><select name="auto_url_parsing_enable">
                                <?php if ($auto_url_parsing_enable) { ?>
                                <option value="1" selected="selected"><?php echo $text_enabled; ?></option>
                                <option value="0"><?php echo $text_disabled; ?></option>
                                <?php } else { ?>
                                <option value="1"><?php echo $text_enabled; ?></option>
                                <option value="0" selected="selected"><?php echo $text_disabled; ?></option>
                                <?php } ?>
                            </select></td>
                        </tr>
                    </table>
                </div>
                <div id="tab-system">
                    <table class="form">
                        <tr>
                            <td><?php echo $entry_inbox_max_pm; ?></td>
                            <td><input type="text" name="inbox_max_pm" value="<?php echo $inbox_max_pm; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_sent_message_max_pm; ?></td>
                            <td><input type="text" name="sent_message_max_pm" value="<?php echo $sent_message_max_pm; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_flood_limit; ?></td>
                            <td><input type="text" name="flood_limit" value="<?php echo $flood_limit; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_topic_be_read_time; ?></td>
                            <td><input type="text" name="topics_be_read_time" value="<?php echo $topics_be_read_time; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_poll_ip_vote_time_limit; ?></td>
                            <td><input type="text" name="poll_ip_vote_time_limit" value="<?php echo $poll_ip_vote_time_limit; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_online_time_span; ?></td>
                            <td><input type="text" name="online_time_span" value="<?php echo $online_time_span; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_warning_decrement_time_span; ?></td>
                            <td><input type="text" name="warning_decrement_time_span" value="<?php echo $warning_decrement_time_span; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_warning_ban_count; ?></td>
                            <td><input type="text" name="warning_ban_count" value="<?php echo $warning_ban_count; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_warning_ban_time_span; ?></td>
                            <td><input type="text" name="warning_ban_time_span" value="<?php echo $warning_ban_time_span; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_daily_bonus; ?></td>
                            <td><input type="text" name="daily_bonus" value="<?php echo $daily_bonus; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_lottery_cost; ?></td>
                            <td><input type="text" name="lottery_cost" value="<?php echo $lottery_cost; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_community_email; ?></td>
                            <td><input type="text" name="config_community_email" value="<?php echo $config_community_email; ?>" /></td>
                        </tr>
                        <tr>
                            <td><?php echo $entry_yourday_forum; ?></td>
                            <td><select name="your_day_forum_id">
                                <?php foreach ($your_day_forums as $your_day_forum) { ?>
                                <?php if ($your_day_forum['forum_id'] == $your_day_forum_id) { ?>
                                    <option value="<?php echo $your_day_forum['forum_id']; ?>" selected="selected"><?php echo $your_day_forum['forum_name']; ?></option>
                                    <?php } else { ?>
                                    <option value="<?php echo $your_day_forum['forum_id']; ?>"><?php echo $your_day_forum['forum_name']; ?></option>
                                    <?php } ?>
                                <?php } ?>
                            </select></td>
                        </tr>
                    </table>
                </div>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript"><!--
$('#tabs a').tabs();
//--></script>
<?php echo $footer; ?>